#include<bits/stdc++.h>
using namespace std;
bool Miss;
namespace IO{
    const int BUF=1<<21;
    char buff[BUF],*p1=buff,*p2=buff;
    #define gc() (p1==p2&&(p2=((p1=buff)+fread(buff,1,BUF,stdin)),p1==p2)?EOF:*p1++)
    template<typename T>inline void read(T &x){
        char ch=gc();x=0;int f=1;
        while(!isdigit(ch)){if(ch=='-')f=-1;ch=gc();}
        while(isdigit(ch)) x=(x<<1)+(x<<3)+(ch^48),ch=gc();
        x*=f;
    }
}
using namespace IO;
const int N=2e5+5;
int n,V,M;
struct node{int a,h;}a[N];
inline bool cmp(node x,node y){return x.a==y.a?x.h>y.h:x.a<y.a;}
long long ans,f[N];
long long mi[N],val[N];
inline void add(int x,long long y){
	int k=(x-1)/M;
	for(int i=0;i<=k;++i) val[i]=min(val[i],y);
	int l=max(k*M,1);
	for(int i=l;i<=x;++i) mi[i]=min(mi[i],y);
}
inline long long query(int x){
	int k=(x-1)/M;
	return min(mi[x],val[k+1]);
}
int main(){
	freopen("xinyue.in","r",stdin);
	freopen("xinyue.out","w",stdout);
	read(n),read(a[n+1].a);
	for(int i=1;i<=n;++i) read(a[i].a),read(a[i].h),--a[i].h,V=max(V,max(a[i].a,a[i].h));
	++n;
	sort(a+1,a+n+1,cmp);
	M=sqrt(V)+1;
	for(int i=0;i<=V+1;++i) mi[i]=val[i]=1ll<<55;
	long long sum=0;
	for(int i=1;i<=n;++i){
		long long now=1ll*a[i].h/a[n].a*a[i].a;
		sum+=now;
		if(!a[i].h) f[i]=0;
		else{
			int H=a[i].h;
			f[i]=(H<V?query(H+1)-now:1ll<<55);
			for(int l=1,r;l<=H;l=r+1){
				r=min(H,H/(H/l));
				f[i]=min(f[i],query(l)+1ll*H/l*a[i].a-now);
			}
		}
		add(a[i].a,f[i]);
	}
	printf("%lld",f[n]+sum);
	return 0;
}


